#include "gps_dop.h"


GPS_dop::GPS_dop(int h,int v,int p)
{
    _hdop = h;
    _vdop = v;
    _pdop = p;
}

GPS_dop::GPS_dop(const GPS_dop& other)
{
    _hdop = other._hdop;
    _vdop = other._vdop;
    _pdop = other._pdop;
}

int GPS_dop::hdop() const
{
    return _hdop;
}

void GPS_dop::setHdop(int d)
{
    if ( d != _hdop )
        _hdop = d;
}

int GPS_dop::vdop() const
{
    return _vdop;
}

void GPS_dop::setVdop(int d)
{
    if ( d != _vdop )
        _vdop = d;
}

int GPS_dop::pdop() const
{
    return _pdop;
}

void GPS_dop::setPdop(int d)
{
    if ( d != _pdop )
        _pdop = d;
}

QString GPS_dop::serialize() const
{
    return QString("%1 %2 %3").arg( hdop() )
                              .arg( vdop() )
                              .arg( pdop() );
}

GPS_dop GPS_dop::unserialize(QTextStream & stream )
{
    int h,v,p;
    stream >> h;
    stream >> v;
    stream >> p;
    return GPS_dop( h, v, p );
}
